|
|
@@ -52,10 +52,10 @@ end
|
52
|
52
|
|
53
|
53
|
def load_and_run(agents)
|
54
|
54
|
agents.group_by { |agent| agent.options[:twitter_username] }.each do |twitter_username, agents|
|
55
|
|
- filter_to_agent_map = agents.map { |agent| agent.options[:filters] }.flatten.uniq.compact.inject({}) { |m, f| m[f] = []; m }
|
|
55
|
+ filter_to_agent_map = agents.map { |agent| agent.options[:filters] }.flatten.uniq.compact.map(&:strip).inject({}) { |m, f| m[f] = []; m }
|
56
|
56
|
|
57
|
57
|
agents.each do |agent|
|
58
|
|
- agent.options[:filters].uniq.map(&:strip).each do |filter|
|
|
58
|
+ agent.options[:filters].flatten.uniq.compact.map(&:strip).each do |filter|
|
59
|
59
|
filter_to_agent_map[filter] << agent
|
60
|
60
|
end
|
61
|
61
|
end
|